<!doctype html>
<html class="no-js">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>{$system_name}</title>
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <!-- No Baidu Siteapp-->
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!-- Add to homescreen for Chrome on Android -->
    <meta name="mobile-web-app-capable" content="yes">
    <!-- Add to homescreen for Safari on iOS -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <!-- Tile icon for Win8 (144x144 + tile color) -->
    <meta name="msapplication-TileColor" content="#0e90d2">
    <!-- SEO: If your mobile URL is different from the desktop URL, add a canonical link to the desktop page https://developers.google.com/webmasters/smartphone-sites/feature-phones -->
    <!--
  <link rel="canonical" href="http://www.example.com/">
  -->
    <link rel="stylesheet" href="__PUBLIC__/assets/css/amazeui.min.css">
    <link rel="stylesheet" href="__PUBLIC__/assets/css/app.css">
    <!--<link rel="stylesheet" href="__PUBLIC__/assets/css/index.css">-->
    <!--必要样式-->
    <style>

        .box {
            background: url("__PUBLIC__/images/apply_agent_bg.png");
            background-size: cover;
            height: auto;
        }

        .text span {
            display: block;
        }
    </style>
</head>

<body>
<header data-am-widget="header" class="am-header am-header-default">
    <div class="am-header-left am-header-nav">
        <a href="__APP__/Home/Me" class="">
            <img src="__PUBLIC__/assets/i/left.png" alt="" style="margin: 5px">
        </a>
    </div>
    <h1 class="am-header-title">
        <a href="#title-link" class="">
            申请代理
        </a>
    </h1>
</header>

<div class="am-g box" style="">
    <div class="am-u-sm-12 am-text-center" style="margin-top: 25px;color: #F5B557;font-size: 20px;font-family: '微软雅黑">
        <span>扫一扫 联系客服</span>
    </div>
    <div class="am-u-sm-12 am-text-center" style="">

        <img src="__ROOT__/{$code}" width="180" height="180" id="ercode" alt="" style="background: url('__PUBLIC__/images/ercode_bg2.png');background-size:100% 100%;padding: 30px;">
        <!--<img src="__PUBLIC__/images/agent_ercode_bg.png" width="50%" alt="">-->
    </div>
    <div class="am-u-sm-12 am-text-center" style="color: #F5B557;font-size: 16px;font-family: '微软雅黑">
        <span>{$system_name}代理申请通道</span><br/><br/>
        <span>详情请咨询客服</span>
    </div>
    <!--<div class="am-u-sm-12 text" style="color: #F5B557;font-size: 14px;font-family: '微软雅黑';padding-left: 25px;">-->
        <!--&lt;!&ndash;<span>一：申请条件：</span>&ndash;&gt;-->
        <!--&lt;!&ndash;<span>&nbsp;&nbsp;&nbsp;&nbsp;1.申请微风竞技代理需4000钻石。</span>&ndash;&gt;-->
        <!--&lt;!&ndash;<span>二：代理收益：</span>&ndash;&gt;-->
        <!--&lt;!&ndash;<sapn>&nbsp;&nbsp;&nbsp;&nbsp;1.代理享有推广奖励（每推广1个玩家在平台完成3场对战即奖励10元）</sapn>&ndash;&gt;-->
        <!--&lt;!&ndash;<span>&nbsp;&nbsp;&nbsp;&nbsp;2.代理享有分享奖励（分享自己推广二维码，每一次被点击获得0.1元）</span>&ndash;&gt;-->
        <!--&lt;!&ndash;<span>&nbsp;&nbsp;&nbsp;&nbsp;3.代理享有对战分红（旗下所有用户对战5%收益）</span>&ndash;&gt;-->
        <!--&lt;!&ndash;<span>三：代理扶持：</span>&ndash;&gt;-->
        <!--&lt;!&ndash;<span>&nbsp;&nbsp;&nbsp;&nbsp;1.代理享有公司技术扶持。</span>&ndash;&gt;-->
        <!--&lt;!&ndash;<span>&nbsp;&nbsp;&nbsp;&nbsp;2.代理享有公司推广扶持。</span>&ndash;&gt;-->
        <!--&lt;!&ndash;<span>&nbsp;&nbsp;&nbsp;&nbsp;3.代理享有赛事专场申请资格。</span>&ndash;&gt;-->
        <!--&lt;!&ndash;<sapn>四：更多政策</sapn>&ndash;&gt;-->
        <!--<span>&nbsp;&nbsp;&nbsp;&nbsp;详情请咨询客服</span>-->
    <!--</div>-->

    <div class="am-u-sm-12 am-text-center" >
        <a href="#" onclick="applyAgent()"><img src="__PUBLIC__/images/agent_btn.png" width="70%" style="padding: 12px 0" alt=""></a>
    </div>
</div>



<div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm">
    <div class="am-modal-dialog">
        <div class="am-modal-bd">

        </div>
        <div class="am-modal-footer">
            <span class="am-modal-btn" data-am-modal-cancel>取消</span>
            <span class="am-modal-btn"  style="color: #0096FF;" data-am-modal-confirm>确定</span>
        </div>
    </div>
</div>

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="__PUBLIC__/assets/js/jquery.min.js"></script>
<script src="__PUBLIC__/assets/js/angular.min.js"></script>
<script src="__PUBLIC__/assets/js/amazeui.min.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
<script>
    $(function(){

        var winH = window.screen.height;
        console.log(winH);

        var boxH = $(".box").height();
        console.log(boxH);
        if(winH-49>boxH){
            $(".box").height(winH-49);
        }

    });

    function applyAgent(){
        layer.confirm('需缴纳30000钻石代理费是否成为代理', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.ajax({
                url: "__APP__/Home/Me/ajaxApplyAgent",
                type: "post",
                dataType: "json",
                success: function (data) {
                    console.info(data);
                    if (data.code != 1)
                        layer.msg(data.message);
                    if (data.success) {
                        layer.msg('您已成为代理请联系客服')
                    } else {
                        if (data.code == 1) {
                            //钻石不足
                            layer.confirm(data.message, {
                                btn: ['充值','取消'] //按钮
                            }, function(){
                                window.location.href='__APP__/Home/Recharge/';
                            }, function(){

                            });
                        }
                    }
                },
                error: function (data) {
                    layer.msg('服务器繁忙！', {type: 1, time: 1000}, function () {
//                        location.reload();
                    });
                }
            });
        }, function(){

        });
    }

    $(function () {
//        $("#ercode").css('height',$("#ercode").width());
//        console.log($("#ercode").height());
    })
</script>
</body>
</html>

